using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

/**
*@file       GWRequest_ServerInfoSender.cs
*@brief      send message GWRequest_ServerInfo
*
*@author     graywind
*@version    1.0.0.1
*@data       2012/3/23
*/

//send message GWRequest_ServerInfo
public class msgGWRequest_ServerInfo
{
    public const int MessageId = (int)GatewayServerTypes.MessageType.GWRequest_ServerInfo;
    //TODO
	public int SessionId = NetLib.INVALID_SESSION;
	public gatewayserver.ServerInfoRequest MsgContent = new gatewayserver.ServerInfoRequest();
	/// <summary>
	/// Initializes a new instance of the <see cref="msgGWRequest_ServerInfo"/> class.
	/// </summary>
	/// <param name='session_id'>
	/// Session_id.
	/// </param>
	/// <param name='server_type'>
	/// Server_type.
	/// </param>
	/// <param name='world_group'>
	/// World_group.
	/// </param>
	public msgGWRequest_ServerInfo(int session_id, global.eServerType server_type, int world_group)
	{
		SessionId = session_id;
		MsgContent.ServerType = server_type;
		MsgContent.WorldGroup = world_group;
	}
	/// <summary>
	/// Initializes a new instance of the <see cref="msgGWRequest_ServerInfo"/> class.
	/// </summary>
	/// <param name='session_id'>
	/// Session_id.
	/// </param>
	/// <param name='server_type'>
	/// Server_type.
	/// </param>
	public msgGWRequest_ServerInfo(int session_id, global.eServerType server_type)
	{
		SessionId = session_id;
		MsgContent.ServerType = server_type;
		MsgContent.WorldGroup = GlobalDef.INVALID_WORLD_GROUP;
	}
}

//handle message
public partial class gwMessagePort
{
    /// <summary>
    /// handle message
    /// </summary>
    /// <param name="msg">message wrapper of GWRequest_ServerInfo</param>
    public static void ProcessMessage(msgGWRequest_ServerInfo msg)
    {
        //TODO
        //Main Message:  msgGatewayServer
		msgGatewayServer mainMsg = new msgGatewayServer(msg.SessionId, msgGWRequest_ServerInfo.MessageId, ProtoNet<gatewayserver.ServerInfoRequest>.IntoBytes(msg.MsgContent));
		gwMessagePort.ProcessMessage(mainMsg);
    }
}
